package com.sawyerqiu.model;

/**
 * @author : SawyerQiu
 * @date : 2024/7/22 16:38
 */
public class Result {

    private static final Result SUCCESS = new Result(true);

    private boolean success;

    private String tip;

    public Result(boolean success) {
        this.success = success;
    }

    public static Result getSUCCESS() {
        return SUCCESS;
    }

    public static Result valueOfFail(String tip){
        Result result = new Result(false);
        result.tip = tip;
        return result;
    }

    public boolean isSuccess() {
        return success;
    }

    public boolean isFail() {
        return !isSuccess();
    }

    public String getTip() {
        return tip;
    }
}
